#ifndef PHYSICAL_CONSTANTS_H
#define PHYSICAL_CONSTANTS_H

#include "fuel_cell_infos.h"

// Types
enum mat_types { TYPE_GAZ, TYPE_SOLID, TYPE_LIQUID };

typedef struct s_material{
    char name[16];
    tData K;
    tData CP;
    tData Rho;
    tData H;
    tData Tinit;
    enum mat_types type;
} Material;

//#define NB_MATRIX       3

// Cell dimensions
#define CELL_L      0.144*3 // profondeur
#define CELL_W      0.74 // Largeur
#define CELL_H      0.0085 // hauteur
#define CANAL_SIZE_X   0.00135
#define CANAL_SIZE_Y   0.00125
#define CANAL_SIZE_Z   0.114
#define PLAQUE_SIZE_X           0.001       // [m] Epaisseur Plaque
#define ANODE_SIZE_X            0.00018     // [m] Epaisseur Anode
#define ANODE_REACT_SIZE_X      0.00005
#define MEMBRANE_SIZE_X         0.000175    // [m] epaisseur membrane
#define CATHODE_REACT_SIZE_X    0.00005     // [m]
#define CATHODE_SIZE_X          0.00018     // [m] epaisseur cathode
#define FICTIF_SIZE_X           0.
#define PLAQUE_SIZE_Y           0.0007      // [m]
#define VOILE_SIZE_Y            0.0007      // [m]
#define FICTIF_SIZE_Y           0.

// Chaleurs specifique [J.kg^-1.K^-1]
#define PHYS_CP_AIR  1004.          // 1.01 J/gC a 25 C
#define PHYS_CP_H2  14304.
#define PHYS_CP_V   1.9156

// Masses molaire
#define PHYS_M_H2   1.              // Masse molaire de l'hydrogene
#define PHYS_M_O2   16.
#define PHYS_M_AIR  28.966
//#define PHYS_M_EAU  18
#define PHYS_M_EAU  ((0.4015*0.355) / (2.*1000.))



// Vitesse gaz
#define PHYS_nuV_AIR  0.0000185
#define PHYS_nuV_H2   0.0000185       // To define
#define PHYS_Dh       ((4*CANAL_SIZE_X*CANAL_SIZE_Y)/(2*(CANAL_SIZE_X+CANAL_SIZE_Y)))
#define PHYS_Nu_eau   3.09
#define PHYS_Nu_gaz   4.12


#define PHYS_F      96485.33        // Constante de Faraday
#define PHYS_X_O2   0.21            // Fraction molaire oxygene

#define PHYS_UT_H2  1.2             // Utilisation hydrogene
#define PHYS_UT_AIR 1.5             // Utilisation air

#define PHYS_I      3000           // Densite de courant A/m^2 , incertain?

#define PHYS_LV       44000.        // [J.mol^-1]
#define PHYS_TDELTAS -48700.

#define PHYS_B_O2   0.120           //[mV dec-1]
#define PHYS_I0_O2  0.0047          // [A/cm-2)
#define PHYS_ALPHA  2.5

#define PHYS_NB_CC  10.0            // Nombre de cannaux cathode
#define PHYS_NB_CA  10.0            // Nombre de cannaux anode
#define PHYS_NB_CELLS   1.0         // Nombre de cellules

#define PHYS_P_A    100000.0        // Pa
#define PHYS_P_C    100000.0        // Pc
#define PHYS_P_SAT  31911.0         // Pas_sat = 10^(A*Thum/(B+Thum)+C)''

#define PHYS_HUMIDITY_H2    0.5
#define PHYS_HUMIDITY_AIR   0.5

#define PHYS_G 100

#define PHYS_IO2 = 0.0047   [A.m^-2]

//PHYS_LOG = LOG(I / IO2)
#define PHYS_LOG 13.388066543137334

//Constante des gaz parfaits.
#define PHYS_R 8.3145

// Reau * muEau / (RhoEau * 2)

#endif

